<template>
	<view>
		<zmm-watermark :watermark="userStore.watermark" v-if="userStore.watermark"></zmm-watermark>
		<view class="content detail">
			<!--KPI岗位-->
			<view class="detail-item">
				<uni-section title="KPI岗位" type="line"></uni-section>
				<view class="detail-content">
					<view class="detail-text">岗位名称：<text>{{`${info.userPostName}【${info.level}】`}}</text></view>
					<view class="detail-text">岗位职级：<text>{{info.level}}</text></view>
					<view class="detail-text">
						积分：
						<text class="table-td-text">{{info.integral}}</text></view>
					<view class="detail-text">
						基本工资：
						<text class="table-td-text">{{info.basePay}}</text></view>
					<view class="detail-text">
						绩效：
						<text class="table-td-text">{{info.performance}}</text></view>
					<!-- <view class="detail-text">直推提成(%)：<text>{{info.directRatio}}%</text></view>
					<view class="detail-text">继承提成(%)：<text>{{info.extendRatio}}%</text></view> -->
					<view class="detail-text">工作性质：<text>{{arrText(kpiPostInsideJobList, info.insideJob)}}</text></view>
					<view class="detail-text">工作形式：<text>{{arrText(kpiPostPartTimeJobList, info.partTimeJob)}}</text></view>
					<view class="detail-text">岗位职责：<text>{{info.responsibilities}}</text></view>
					<view class="detail-text">招聘要求：<text>{{info.requirements}}</text></view>
					<view class="detail-text">晋升条件：<text>{{info.promotionConditions}}</text></view>
					<view class="detail-text">备注：<text>{{info.remark}}</text></view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { computed, onMounted, ref } from 'vue';
import { tab, auth, modal } from "@/plugins"
import { getTitle } from "@/utils/getter"
import { checkPermi, checkRole, checkOnlyPermi, checkOnlyRole } from "@/utils/permission"
import { kpiPostDetail } from "@/api/erp_api/kpi"
import { copyText, arrText, previewImg } from '@/utils/ty.js';
import { kpiPostInsideJobList, kpiPostPartTimeJobList } from '@/utils/config.js'
import useUserStore from '@/store/modules/user'

	const userStore = useUserStore()
	onLoad((option) => {
		if (option.id) {
			id.value = option.id
			getDetail()
		}
	})
	
	// 数据查询
	const id = ref('')
	const info = ref({})
	const isLoading = ref(false)
	
	const getDetail = () => {
		const params = {
			id: id.value
		}
		isLoading.value = true
		uni.showLoading({
			title: '数据加载中...'
		})
		kpiPostDetail(params).then(res => {
			info.value = res.data || {}
			isLoading.value = false
			uni.hideLoading()
    }).catch(() => {
			isLoading.value = false
			uni.hideLoading()
		})
	}
	
</script>

<style scoped lang="scss">
</style>
